package cn.wk.servlet;

import cn.wk.entity.Score;
import cn.wk.services.ScoreServices;
import cn.wk.services.impl.ScoreServicesImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/scoreedits")
public class Servletscoreedits extends HttpServlet {
    private ScoreServices ss=new ScoreServicesImpl();
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        String no=(String)request.getSession().getAttribute("no");
        String couname = request.getParameter("couname");
        List<Score> list=ss.getAlls(no,couname);
        if(list!=null){
            request.setAttribute("list",list);
            request.getRequestDispatcher("/scoreeidt.jsp").forward(request,response);
        }

    }
}
